package com.ji.service;

import com.ji.dao.UserMapper;
import com.ji.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public int addUser(User user) {
        return userMapper.addUser (user);
    }

    @Override
    public int deleteUser(int id) {
        return userMapper.deleteUser (id);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser (user);
    }

    @Override
    public User queryUser(String username) {
        return userMapper.queryUser (username);
    }

    @Override
    public User queryUserById(int id) {
        return userMapper.queryUserById (id);
    }

    @Override
    public List<User> queryAllUser() {
        return userMapper.queryAllUser ();
    }
}
